package com.latefly.skewwork.ui.page.self.setting

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController

@Composable
fun Setting(
    navController: NavHostController,
    modifier: Modifier = Modifier
) {
    Column(
        horizontalAlignment = Alignment.CenterHorizontally
    ) {

        Text(text = "用户设置")

        val list = listOf<String>(
            "软件升级",
            "更改密码",
        )
        for (item in list) {
            Button(
                onClick = {},
                modifier = Modifier
                    .padding(horizontal = 16.dp)
                    .padding(top = 10.dp)
                    .height(48.dp)
                    .fillMaxWidth()
            ) {
                Text(text = "$item")
            }
        }
        Button(
            onClick = {
                navController.navigate("Login")
            },
            modifier = Modifier
                .padding(horizontal = 16.dp)
                .padding(top = 10.dp)
                .height(48.dp)
                .fillMaxWidth()
        ) {
            Text(text = "退出登录")
        }
        Button(
            onClick = {
                navController.navigate("Self")
            }, modifier = Modifier
                .padding(horizontal = 16.dp)
                .padding(top = 10.dp)
                .height(48.dp)
                .fillMaxWidth()
        ) {
            Text(text = "返回")
        }
    }

}